<!--#include file="const.asp" -->
<!--#include file="common/md5.asp" -->
<!--#include file="common/funciton.asp" -->
<%
rdid=request.querystring("id")
if rdid="" then rdid=0

for i=0 to diarynum
if GDInfo("diary_id",i) = rdid then
rdid=i
end if
next

plid=request.querystring("plid")
if plid="" then plid=0
page=request.querystring("PageNo")
	D_tittle=GDInfo("diary_tittle",rdid)
	thispagetittle=D_tittle
	D_time=GDInfo("diary_time",rdid)
	D_path=GDInfo("diary_path",rdid)
	D_kind=GDInfo("diary_kind",rdid)
	D_tags=GDInfo("diary_tags",rdid)
	D_user=GDInfo("diary_un",rdid)
	D_text=readtext(D_path)

	dim keyWord,n
	D_tags=split(D_tags,",")
	For n=LBound(D_tags)  To UBound(D_tags)
	D_tags2=D_tags2 & " " & D_tags(n)
	Next

D_tags=D_tags2
%><!--#include file="head.asp" --><%
Set ArcitleGuestBookSite=diaryl.childNodes.item(rdid).childNodes.item(4)
ArcitleGuestBookSiteNum=ArcitleGuestBookSite.childNodes.length-1
if page="" then page=1
if CINT((ArcitleGuestBookSiteNum+1)/plc) < (ArcitleGuestBookSiteNum+1)/plc then
pagec=CINT((ArcitleGuestBookSiteNum+1)/plc)+1
else
pagec=(ArcitleGuestBookSiteNum+1)/plc
end if
		if ArcitleGuestBookSiteNum < page*plc then
			pagestart=(page-1)*plc
			pageend=ArcitleGuestBookSiteNum
		else
			pagestart=(page-1)*plc
			pageend=page*plc-1
		end if
for i=pagestart to pageend
i_=ArcitleGuestBookSiteNum-i
		id=ArcitleGuestBookSite.childNodes.item(i_).childNodes.item(0).text
		username  =ArcitleGuestBookSite.childNodes.item(i_).childNodes.item(1).text
		fromwhere =ArcitleGuestBookSite.childNodes.item(i_).childNodes.item(2).text
		Posttime  =ArcitleGuestBookSite.childNodes.item(i_).childNodes.item(3).text
		homepage  =ArcitleGuestBookSite.childNodes.item(i_).childNodes.item(4).text
		email     =ArcitleGuestBookSite.childNodes.item(i_).childNodes.item(5).text
		text      =ArcitleGuestBookSite.childNodes.item(i_).childNodes.item(6).text
		if text   ="" then text="&nbsp"
			guestbookfeed_pl=readtext(skinf&"\boards\guestbook\pl.html")
			guestbookfeed_pl=replace(guestbookfeed_pl,"<$id$>",id)
			guestbookfeed_pl=replace(guestbookfeed_pl,"<$i_$>",i_)
			guestbookfeed_pl=replace(guestbookfeed_pl,"<$rdid$>",request.querystring("id"))
			guestbookfeed_pl=replace(guestbookfeed_pl,"<$StarNodes$>",StarNodes)
			guestbookfeed_pl=replace(guestbookfeed_pl,"<$fromwhere$>",fromwhere)
			guestbookfeed_pl=replace(guestbookfeed_pl,"<$homepage$>",homepage)
			guestbookfeed_pl=replace(guestbookfeed_pl,"<$MD5(email)$>",md5(email))
			guestbookfeed_pl=replace(guestbookfeed_pl,"<$username$>",username)
			guestbookfeed_pl=replace(guestbookfeed_pl,"<$Posttime$>",Posttime)
			guestbookfeed_pl=replace(guestbookfeed_pl,"<$GravatarSize$>",Gravatar_Size)
			guestbookfeed_pl=replace(guestbookfeed_pl,"<$GravatarAutoUrl$>",Gravatar_AutoUrl)
			guestbookfeed_pl=replace(guestbookfeed_pl,"<$GravatarType$>",Gravatar_Type)
			guestbookfeed_pl=replace(guestbookfeed_pl,"<$text$>",text)
			set hfRootsite=ArcitleGuestBookSite.childNodes.item(i_).childNodes.item(7)
			hfnum=hfRootsite.childNodes.length-1
			for hfi=0 to hfnum
				hfid=hfRootsite.childNodes.item(hfi).childNodes.item(0).text
				hfusername=hfRootsite.childNodes.item(hfi).childNodes.item(1).text
				hffromwhere=hfRootsite.childNodes.item(hfi).childNodes.item(2).text
				hfPosttime=hfRootsite.childNodes.item(hfi).childNodes.item(3).text
				hfhomepage=hfRootsite.childNodes.item(hfi).childNodes.item(4).text
				hfemail=hfRootsite.childNodes.item(hfi).childNodes.item(5).text
				hftext=hfRootsite.childNodes.item(hfi).childNodes.item(6).text
				if hftext="" then hftext="&nbsp"
				guestbookfeed_temp_hf=readtext(skinf&"\boards\guestbook\hf.html")
				guestbookfeed_temp_hf=replace(guestbookfeed_temp_hf,"<$hfid$>",hfid)
				guestbookfeed_temp_hf=replace(guestbookfeed_temp_hf,"<$hffromwhere$>",hffromwhere)
				guestbookfeed_temp_hf=replace(guestbookfeed_temp_hf,"<$hfhomepage$>",hfhomepage)
				guestbookfeed_temp_hf=replace(guestbookfeed_temp_hf,"<$MD5(hfemail)$>",MD5(hfemail))
				guestbookfeed_temp_hf=replace(guestbookfeed_temp_hf,"<$hfusername$>",hfusername)
				guestbookfeed_temp_hf=replace(guestbookfeed_temp_hf,"<$hfPosttime$>",hfPosttime)
				guestbookfeed_temp_hf=replace(guestbookfeed_temp_hf,"<$GravatarSize$>",Gravatar_Size)
				guestbookfeed_temp_hf=replace(guestbookfeed_temp_hf,"<$GravatarAutoUrl$>",Gravatar_AutoUrl)
				guestbookfeed_temp_hf=replace(guestbookfeed_temp_hf,"<$GravatarType$>",Gravatar_Type)
				guestbookfeed_temp_hf=replace(guestbookfeed_temp_hf,"<$hftext$>",hftext)
				guestbookfeed_hf=guestbookfeed_hf&guestbookfeed_temp_hf
			next
				guestbookfeed2=replace(guestbookfeed_pl,"<$hf$>",guestbookfeed_hf)
				guestbookfeed=guestbookfeed&guestbookfeed2
	guestbookfeed_hf=""
	StarNodes=StarNodes-1
next
			dim pageContentfeed,pageContentfeeds,thispageContent,elsepageContent,elsepageContent_temp
			pageContentfeed=readtext(skinf&"/boards/pageContent/pageContent.html")
			thispageContent=readtext(skinf&"/boards/pageContent/thispage.html")
			elsepageContent=readtext(skinf&"/boards/pageContent/elsepage.html")

			for i=1 to pagec
			elsepageContent_temp=""
				if i=page then
				pageContentfeeds = pageContentfeeds & replace(thispageContent,"<$page_number$>",i)
				else
				elsepageContent_temp = replace(elsepageContent,"<$page_number$>",i)
				elsepageContent_temp = replace(elsepageContent_temp,"<$URL$>","article.asp?id="&request.querystring("id")&"&PageNo="&i)
				pageContentfeeds=pageContentfeeds&elsepageContent_temp	
			end if

			next
			pageContentfeed=replace(pageContentfeed,"<$pageContents$>",pageContentfeeds)

if request.querystring("hf")="y" then
postmsg="?t=h&plid=" & plid & "&rdid=" & rdid
hf_msg="&#24744;&#23558;&#23545;&#36873;&#25321;&#30340;&#30041;&#35328;&#36827;&#34892;&#22238;&#22797;"
else
postmsg="?t=p&rdid=" & rdid
hf_msg="&#24744;&#21487;&#20197;&#22312;&#27492;&#26412;&#25991;&#31456;&#36827;&#34892;&#35780;&#35770;"
end if

articlefeed=readtext(skinf&"/boards/article.html")
articlefeed=replace(articlefeed,"<$rdid$>",rdid)
articlefeed=replace(articlefeed,"<$D_kind$>",D_kind)
articlefeed=replace(articlefeed,"<$D_name$>",D_tittle)
articlefeed=replace(articlefeed,"<$D_user$>",D_user)
articlefeed=replace(articlefeed,"<$D_time$>",D_time)
articlefeed=replace(articlefeed,"<$D_time$>",D_user)
articlefeed=replace(articlefeed,"<$D_tags$>",D_tags)
articlefeed=replace(articlefeed,"<$D_text$>",D_text)
articlefeed=replace(articlefeed,"<$guestbookfeed$>",guestbookfeed)
articlefeed=replace(articlefeed,"<$pagelinks$>",pageContentfeed)
articlefeed=replace(articlefeed,"<$postmsg$>",postmsg)
articlefeed=replace(articlefeed,"<$hf_msg$>",hf_msg)
articlefeed=replace(articlefeed,"<$sidebar$>",sidebar)
articlefeed=replace(articlefeed,"<$footer$>",footer)
%><%=articlefeed%> 